import { getCookie, setCookie } from '@/utils/cookie';
import { useCallback, useState } from 'react';

const Token = () => {
  const [token, setToken] = useState(getCookie('token') || '');
  const saveToken = useCallback((value: string) => {
    setCookie('token', value);
    setToken(value);
  }, []);

  return { token, saveToken };
};

export default Token;
